/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import DAO.Fechas;
import DAO.ValidarRutDAO;
import DAO.garantiasDAO;
import DTO.ReporteInformeTotalGarantiaAutoDTO;
import DTO.ReporteInformeTotalGarantiaCDPDTO;
import DTO.ReporteInformeTotalGarantiaDTO;
import DTO.ReporteInformeTotalGarantiaWarrantDTO;
import DTO.TodasLasGarantiasDTO;
import DTO.estadoGarantiaDTO;
import DTO.garantiaAutomotrizDTO;
import DTO.garantiaHipotecariaDTO;
import DTO.garantiaWarrantsDTO;
import DTO.garantiaCdpOtrosDTO;
import DTO.usuarioDTO;
import java.awt.Color;
import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.swing.JRViewer;


/**
 *
 * @author Luis Olave 10
 */
public class InformeTotalGtia extends javax.swing.JFrame {

   garantiasDAO garaHipo = new garantiasDAO();
   garantiasDAO garaAuto = new garantiasDAO();
   garantiasDAO garaCdp = new garantiasDAO();
   garantiasDAO garaWarra = new garantiasDAO();
   usuarioDTO user;
   
   
    public InformeTotalGtia(usuarioDTO user) {
        initComponents();
        this.user = user;
        editable();
        rbtHipotecaria.setSelected(true);
        chkBuscarConParametros.setSelected(true);
        jPanelBuscarSinParametros.setVisible(false);
        cargarEstado();
        this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
    }
    
    public void cargarEstado()
    {
        
       ArrayList<estadoGarantiaDTO> cargar = garaHipo.CargarEstadoGarantia();
        int size = cargar.size();
            for (int i = 0; i < size; i++) {
                this.cmbEstadoGarantia.addItem(cargar.get(i));
            }
       
    }
    public void editable()
    {
        Color opaco1 = new Color(240,240,240);
        
       this.txtRut.setBackground(opaco1);
       this.txtRut.setEnabled(false);
       Color opaco = new Color(240,240,240);
       this.txtApellidoPaterno.setBackground(opaco);
       this.txtApellidoPaterno.setEnabled(false);
       this.cmbEstadoGarantia.setEnabled(false);
       this.jCalendarFechaIngresoDesde.setEnabled(false);
       this.jCalendarFechaIngresoHasta.setEnabled(false);
       this.jCalendarFechaVencimientoDesde.setEnabled(false);
       this.jCalendarFechaVencimientoHasta.setEnabled(false);
  
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jPanelBuscarSinParametros = new javax.swing.JPanel();
        btnBuscarSinParametros = new javax.swing.JButton();
        btnVolver1 = new javax.swing.JButton();
        btnImprimirInformeGarantia = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        rbtHipotecaria = new javax.swing.JRadioButton();
        rbtAutomotriz = new javax.swing.JRadioButton();
        rbtWarrant = new javax.swing.JRadioButton();
        rbtCDP = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        chkBuscarSinParametros = new javax.swing.JCheckBox();
        chkBuscarConParametros = new javax.swing.JCheckBox();
        jPanelConParametros = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        rbtRut = new javax.swing.JRadioButton();
        rbtApellidoPaterno = new javax.swing.JRadioButton();
        rbtEstadoGarantia = new javax.swing.JRadioButton();
        rbtFechaIngreso = new javax.swing.JRadioButton();
        rbtFechaVencimiento = new javax.swing.JRadioButton();
        jPanel6 = new javax.swing.JPanel();
        txtRut = new javax.swing.JTextField();
        txtApellidoPaterno = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jCalendarFechaIngresoDesde = new com.toedter.calendar.JDateChooser();
        jCalendarFechaVencimientoDesde = new com.toedter.calendar.JDateChooser();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jCalendarFechaIngresoHasta = new com.toedter.calendar.JDateChooser();
        jCalendarFechaVencimientoHasta = new com.toedter.calendar.JDateChooser();
        btnBuscarPorParametros = new javax.swing.JButton();
        cmbEstadoGarantia = new javax.swing.JComboBox();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbSalidaInforme = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("INFORME TOTAL GARANTÍA");
        setResizable(false);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGE/logo.JPG"))); // NOI18N

        jLabel4.setFont(new java.awt.Font("Century Gothic", 1, 18)); // NOI18N
        jLabel4.setText("INFORME DE GARANTÍAS");

        jLabel1.setText("MENÚ PRINCIPAL\\INFORME DE GARANTÍAS");

        jPanelBuscarSinParametros.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "BUSCAR TODAS", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        btnBuscarSinParametros.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
        btnBuscarSinParametros.setText("BUSCAR");
        btnBuscarSinParametros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarSinParametrosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelBuscarSinParametrosLayout = new javax.swing.GroupLayout(jPanelBuscarSinParametros);
        jPanelBuscarSinParametros.setLayout(jPanelBuscarSinParametrosLayout);
        jPanelBuscarSinParametrosLayout.setHorizontalGroup(
            jPanelBuscarSinParametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBuscarSinParametrosLayout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(btnBuscarSinParametros, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(40, Short.MAX_VALUE))
        );
        jPanelBuscarSinParametrosLayout.setVerticalGroup(
            jPanelBuscarSinParametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelBuscarSinParametrosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnBuscarSinParametros)
                .addContainerGap(23, Short.MAX_VALUE))
        );

        btnVolver1.setText("VOLVER");
        btnVolver1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVolver1ActionPerformed(evt);
            }
        });

        btnImprimirInformeGarantia.setFont(new java.awt.Font("Century Gothic", 0, 11)); // NOI18N
        btnImprimirInformeGarantia.setText("IMPRIMIR");
        btnImprimirInformeGarantia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirInformeGarantiaActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SELECCIONE GARANTÍA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        buttonGroup1.add(rbtHipotecaria);
        rbtHipotecaria.setText("HIPOTECARIA");

        buttonGroup1.add(rbtAutomotriz);
        rbtAutomotriz.setText("AUTOMOTRIZ");

        buttonGroup1.add(rbtWarrant);
        rbtWarrant.setText("WARRANT");

        buttonGroup1.add(rbtCDP);
        rbtCDP.setText("CDP");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rbtHipotecaria)
                .addGap(18, 18, 18)
                .addComponent(rbtAutomotriz)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                .addComponent(rbtWarrant)
                .addGap(18, 18, 18)
                .addComponent(rbtCDP)
                .addGap(16, 16, 16))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtHipotecaria)
                    .addComponent(rbtAutomotriz)
                    .addComponent(rbtWarrant)
                    .addComponent(rbtCDP))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SELECCIONE OPCIÓN", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        buttonGroup2.add(chkBuscarSinParametros);
        chkBuscarSinParametros.setText("BUSCAR SIN PARAMETROS");
        chkBuscarSinParametros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkBuscarSinParametrosActionPerformed(evt);
            }
        });

        buttonGroup2.add(chkBuscarConParametros);
        chkBuscarConParametros.setText("BUSCAR POR PARAMETROS");
        chkBuscarConParametros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chkBuscarConParametrosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(chkBuscarConParametros)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 138, Short.MAX_VALUE)
                .addComponent(chkBuscarSinParametros)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkBuscarSinParametros)
                    .addComponent(chkBuscarConParametros)))
        );

        jPanelConParametros.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "BUSQUEDA", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N
        jPanelConParametros.setPreferredSize(new java.awt.Dimension(509, 165));

        buttonGroup3.add(rbtRut);
        rbtRut.setText("RUT");
        rbtRut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtRutActionPerformed(evt);
            }
        });

        buttonGroup3.add(rbtApellidoPaterno);
        rbtApellidoPaterno.setText("APELLIDO PATERNO");
        rbtApellidoPaterno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtApellidoPaternoActionPerformed(evt);
            }
        });

        buttonGroup3.add(rbtEstadoGarantia);
        rbtEstadoGarantia.setText("ESTADO DE GARANTÍA");
        rbtEstadoGarantia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtEstadoGarantiaActionPerformed(evt);
            }
        });

        buttonGroup3.add(rbtFechaIngreso);
        rbtFechaIngreso.setText("FECHA INGRESO");
        rbtFechaIngreso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtFechaIngresoActionPerformed(evt);
            }
        });

        buttonGroup3.add(rbtFechaVencimiento);
        rbtFechaVencimiento.setText("FECHA VENCIMIENTO");
        rbtFechaVencimiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtFechaVencimientoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(rbtRut)
                        .addComponent(rbtApellidoPaterno)
                        .addComponent(rbtEstadoGarantia)
                        .addComponent(rbtFechaIngreso))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addComponent(rbtFechaVencimiento)
                        .addContainerGap())))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(rbtRut)
                .addGap(3, 3, 3)
                .addComponent(rbtApellidoPaterno)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rbtEstadoGarantia)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rbtFechaIngreso)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(rbtFechaVencimiento)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel3.setText("DESDE");

        jLabel5.setText("DESDE");

        jLabel6.setText("HASTA");

        jLabel7.setText("HASTA");

        btnBuscarPorParametros.setText("BUSCAR");
        btnBuscarPorParametros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarPorParametrosActionPerformed(evt);
            }
        });

        cmbEstadoGarantia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "(SELECCIONE)" }));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtRut, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(cmbEstadoGarantia, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jCalendarFechaIngresoDesde, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtApellidoPaterno, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel6))))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jCalendarFechaVencimientoDesde, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel7)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jCalendarFechaVencimientoHasta, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE)
                    .addComponent(btnBuscarPorParametros, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jCalendarFechaIngresoHasta, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(10, 10, 10))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(txtRut, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtApellidoPaterno, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(btnBuscarPorParametros)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cmbEstadoGarantia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel3)
                    .addComponent(jCalendarFechaIngresoDesde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCalendarFechaIngresoHasta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jCalendarFechaVencimientoDesde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(jCalendarFechaVencimientoHasta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanelConParametrosLayout = new javax.swing.GroupLayout(jPanelConParametros);
        jPanelConParametros.setLayout(jPanelConParametrosLayout);
        jPanelConParametrosLayout.setHorizontalGroup(
            jPanelConParametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelConParametrosLayout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );
        jPanelConParametrosLayout.setVerticalGroup(
            jPanelConParametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelConParametrosLayout.createSequentialGroup()
                .addGroup(jPanelConParametrosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 8, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "ÁREA IMPRESIÓN", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Century Gothic", 1, 10), java.awt.Color.blue)); // NOI18N

        tbSalidaInforme.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        tbSalidaInforme.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
        tbSalidaInforme.setEnabled(false);
        jScrollPane1.setViewportView(tbSalidaInforme);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel3.setMinimumSize(new java.awt.Dimension(100, 105));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 180, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(182, 182, 182))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(btnImprimirInformeGarantia, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(270, 270, 270)
                                .addComponent(btnVolver1))
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addGap(206, 206, 206)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel4))
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jPanelConParametros, javax.swing.GroupLayout.PREFERRED_SIZE, 548, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanelBuscarSinParametros, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addContainerGap())))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(137, 137, 137))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel1))
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addComponent(jPanelBuscarSinParametros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanelConParametros, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnVolver1)
                    .addComponent(btnImprimirInformeGarantia))
                .addGap(166, 166, 166))
        );

        setSize(new java.awt.Dimension(833, 694));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void btnVolver1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVolver1ActionPerformed
        MenuPrincipal venMenuPrincipal = new MenuPrincipal(user);
        venMenuPrincipal.setVisible(true);
        InformeTotalGtia.this.dispose();
    }//GEN-LAST:event_btnVolver1ActionPerformed

    private void chkBuscarSinParametrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkBuscarSinParametrosActionPerformed
        
            jPanelBuscarSinParametros.setVisible(true);
            jPanelConParametros.setVisible(false);
    }//GEN-LAST:event_chkBuscarSinParametrosActionPerformed

    private void btnBuscarSinParametrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarSinParametrosActionPerformed
        this.tbSalidaInforme.setAutoResizeMode(this.tbSalidaInforme.AUTO_RESIZE_OFF);
        this.tbSalidaInforme.getTableHeader().setReorderingAllowed(false);
        this.tbSalidaInforme.getTableHeader().setResizingAllowed(false);
     
        
        try
        {
            
        if(rbtHipotecaria.isSelected())
        {
        
        ArrayList<garantiaHipotecariaDTO> lista = garaHipo.ListarTodoHipo();
        
          
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
        if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "COBERTURA",
                   "SUPERFICIE",
                   "REGISTRO CBR",
                   "ROL SII",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "TIPO CONSTRUCCIÓN",
                   "COMUNA",
                   "ESTADO CONTRIBUCIÓN",
                   "MTRS. CONSTRUIDOS",
                   "ESTADO GARANTÍA"
           
                   };
               modelo.setColumnIdentifiers(arr1);
            }
        
           for(garantiaHipotecariaDTO h: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_crea_hipo()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_extincion_hipo()));
               Object[]arr={
                   h.getFolio_garantia_hipo(),
                   h.getRut_gara_hipo(),
                   h.getNombre_hipo(),
                   h.getApell_paterno_hipo(),
                   h.getApell_materno_hipo(),
                   h.getSucursal_hipo(),
                   h.getCobertura_hipo(),
                   h.getSuperficie_hipo(),
                   h.getRegistro_cbr_hipo(),
                   h.getRol_sii_hipo(),
                   fei,
                   fev,
                   h.getMoneda_hipo(),
                   h.getTipo_construccion_hipo(),
                   h.getComuna_hipo(),
                   h.getEstado_constrib_hipo(),
                   h.getMts_construidos_hipo(),
                   h.getEstado_hipo()
                   };
               
               modelo.addRow(arr);
               
             
           }
        
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(100);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(120);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(100);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(170);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(100);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(170);
           TableColumn colum17 = this.tbSalidaInforme.getColumnModel().getColumn(16);
           colum17.setPreferredWidth(170);
           TableColumn colum18 = this.tbSalidaInforme.getColumnModel().getColumn(17);
           colum18.setPreferredWidth(140);
           
        }
        
        else if(rbtAutomotriz.isSelected())
        {
            ArrayList<garantiaAutomotrizDTO> lista = garaAuto.ListarTodoAuto();
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MARCA",
                   "PATENTE",
                   "N° CHASIS",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "N° MOTOR",
                   "MODELO",
                   "N° REGISTRO PRENDA", 
                   "ESTADO GARANTÍA",
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaAutomotrizDTO a: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_crea_auto()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_extincion_auto()));
               Object[]arr={
                   a.getFolio_garantia_auto(),
                   a.getRut_gara_auto(),
                   a.getNombre_auto(),
                   a.getApell_paterno_auto(),
                   a.getApell_materno_auto(),
                   a.getSucursal_auto(),
                   a.getMarca_auto(),
                   a.getPatente_auto(),
                   a.getNum_chasis_auto(),
                   fei,
                   fev,
                   a.getMoneda_auto(),
                   a.getNum_motor_auto(),
                   a.getModelo_auto(),
                   a.getNum_reg_prenda_auto(),
                   a.getEstado_auto()
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(130);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(110);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(120);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(160);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(130);
        }
        
        else if(rbtWarrant.isSelected())
        {
            ArrayList<garantiaWarrantsDTO> lista = garaWarra.ListarTodoWarra();
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "TIPO PRODUCTO",
                   "PRODUCTO",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaWarrantsDTO w: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_crea_warra()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_exti_warra()));
               Object[]arr={
                   w.getFolio_warra(),
                   w.getRut_garante_warra(),
                   w.getNombre_warra(),
                   w.getApell_paterno_warra(),
                   w.getApell_materno_warra(),
                   w.getNom_sucursal_warra(),
                   w.getTipo_prod_warra(),
                   w.getIngre_prod_warra(),
                   w.getNom_moneda_warra(),
                   fei,
                   fev,
                   w.getEstado_warra()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(170);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(100);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           
        }
        
        else if(rbtCDP.isSelected())
        {
            ArrayList<garantiaCdpOtrosDTO> lista = garaCdp.ListarTodoCdp();
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaCdpOtrosDTO c: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_crea_cdp()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_extin_cdp()));
               Object[]arr={
                   c.getFolio_cdp(),
                   c.getRut_gara_cdp(),
                   c.getNombre_cdp(),
                   c.getApell_paterno_cdp(),
                   c.getApell_materno_cdp(),
                   c.getSucu_cdp(),
                   c.getNom_moneda_cdp(),
                   fei,
                   fev,
                   c.getEstado_cdp()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
        }
        }catch(Exception e)
        {
            e.getMessage();
        }
    }//GEN-LAST:event_btnBuscarSinParametrosActionPerformed

    private void btnImprimirInformeGarantiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirInformeGarantiaActionPerformed
       if(rbtHipotecaria.isSelected())
       {
           if(chkBuscarConParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 10)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 11)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 12)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 13)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 14)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 15)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 16)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 17))+ "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantia.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías Hipotecaría");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
           else if(chkBuscarSinParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 10)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 11)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 12)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 13)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 14)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 15)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 16)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 17))+ "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantia.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías Hipotecaría");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
       }
       else if(rbtAutomotriz.isSelected())
       {
           if(chkBuscarConParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaAutoDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaAutoDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 10)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 11)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 12)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 13)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 14)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 15))+ "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantiaAutomotriz.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías Automotriz");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
           else if(chkBuscarSinParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaAutoDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaAutoDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 10)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 11)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 12)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 13)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 14)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 15))+ "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantiaAutomotriz.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías Automotriz");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
       }
       else if(rbtWarrant.isSelected())
       {
           if(chkBuscarConParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaWarrantDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaWarrantDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 10)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 11))+ "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantiaWarrant.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías Warrant");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
           else if(chkBuscarSinParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaWarrantDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaWarrantDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 10)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 11))+ "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantiaWarrant.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías Warrant");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
       }
       else if(rbtCDP.isSelected())
       {
           if(chkBuscarConParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaCDPDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaCDPDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)) + "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantiaCDP.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías CDP");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
           else if(chkBuscarSinParametros.isSelected())
           {
               try {
            
        int fila= 0;
  
        List Resultados = new ArrayList();
        ReporteInformeTotalGarantiaCDPDTO tipo;
        Resultados.clear();
        
        for(fila = 0; fila< tbSalidaInforme.getRowCount(); fila++)
        {
            
           tipo = new ReporteInformeTotalGarantiaCDPDTO(
                          String.valueOf(tbSalidaInforme.getValueAt(fila, 0)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 1)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 2)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 3)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 4)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 5)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 6)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 7)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 8)),
                   " " +  String.valueOf(tbSalidaInforme.getValueAt(fila, 9)) + "\n");
           Resultados.add(tipo);

        }
        
            String reportSource = "C:\\Users\\SoftGroup\\Documents\\NetBeansProjects\\trunk\\AppGarantias\\build\\classes\\Reporte\\ReporteInformeGarantiaCDP.jrxml";

            JasperReport jr = JasperCompileManager.compileReport(reportSource);
            
            
            JFrame reporte = new JFrame();
            reporte.setSize(900, 700);
            
            reporte.setLocationRelativeTo(null);
            reporte.setTitle("IMPRESIÓN");
            String fechaImpresion = String.valueOf(Fechas.FechaSistema());
            
            Map<String, Object> map = new HashMap<String, Object>();
            
            map.put("Titulo", "Sistema Gestión de Garantías Bancarias");
            map.put("subtitulo", "Informe Garantías CDP");
            map.put("fecha", fechaImpresion);
            map.put("nombreBanco", "Banco xxxxxx");
            
            
            JRBeanCollectionDataSource coleccion = new JRBeanCollectionDataSource(Resultados);
            JasperPrint jp = JasperFillManager.fillReport(jr, map, coleccion);
            JRViewer jv = new JRViewer(jp);
            reporte.getContentPane().add(jv);
            reporte.setVisible(true);
            
            
            
        } catch (JRException e) {
            e.printStackTrace();
            Logger.getLogger(InformeTotalGtia.class.getName()).log(Level.SEVERE, null, e);
        }
           }
       }
       
       
    }//GEN-LAST:event_btnImprimirInformeGarantiaActionPerformed

    private void chkBuscarConParametrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkBuscarConParametrosActionPerformed
        jPanelBuscarSinParametros.setVisible(false);
        jPanelConParametros.setVisible(true);
    }//GEN-LAST:event_chkBuscarConParametrosActionPerformed

    private void btnBuscarPorParametrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarPorParametrosActionPerformed
        this.tbSalidaInforme.setAutoResizeMode(this.tbSalidaInforme.AUTO_RESIZE_OFF);
        this.tbSalidaInforme.getTableHeader().setReorderingAllowed(false);
        this.tbSalidaInforme.getTableHeader().setResizingAllowed(false);
        try
        {
            if(rbtHipotecaria.isSelected())
            {
                if(rbtRut.isSelected())
                {
                    String rut = this.txtRut.getText();
                    ArrayList<garantiaHipotecariaDTO> lista = garaHipo.ListarPorRutHipo(rut);
        
          
                    DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
                    modelo.setNumRows(0);
                    modelo.setColumnCount(0);
                 if(modelo.getColumnCount()<1)
                 {
                    Object[]arr1={
                            "N°FOLIO",
                            "RUT",
                            "NOMBRE",
                            "APELLIDO PATERNO",
                            "APELLIDO MATERNO",
                            "SUCURSAL",
                            "COBERTURA",
                            "SUPERFICIE",
                            "REGISTRO CBR",
                            "ROL SII",
                            "FECHA CREACIÓN",
                            "FECHA EXTINCIÓN",
                            "MONEDA",
                            "TIPO CONSTRUCCIÓN",
                            "COMUNA",
                            "ESTADO CONTRIBUCIÓN",
                            "MTRS. CONSTRUIDOS",
                            "ESTADO GARANTÍA"

                            };
                        modelo.setColumnIdentifiers(arr1);
                     }

                    for(garantiaHipotecariaDTO h: lista)
                    {
                        String fei = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_crea_hipo()));
                        String fev = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_extincion_hipo()));
                        Object[]arr={
                            h.getFolio_garantia_hipo(),
                            h.getRut_gara_hipo(),
                            h.getNombre_hipo(),
                            h.getApell_paterno_hipo(),
                            h.getApell_materno_hipo(),
                            h.getSucursal_hipo(),
                            h.getCobertura_hipo(),
                            h.getSuperficie_hipo(),
                            h.getRegistro_cbr_hipo(),
                            h.getRol_sii_hipo(),
                            fei,
                            fev,
                            h.getMoneda_hipo(),
                            h.getTipo_construccion_hipo(),
                            h.getComuna_hipo(),
                            h.getEstado_constrib_hipo(),
                            h.getMts_construidos_hipo(),
                            h.getEstado_hipo()
                            };

                        modelo.addRow(arr);


                    }

                    TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(100);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(120);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(100);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(170);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(100);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(170);
           TableColumn colum17 = this.tbSalidaInforme.getColumnModel().getColumn(16);
           colum17.setPreferredWidth(170);
           TableColumn colum18 = this.tbSalidaInforme.getColumnModel().getColumn(17);
           colum18.setPreferredWidth(140);

                }
                else if(rbtApellidoPaterno.isSelected())
                {
                    String apellido = this.txtApellidoPaterno.getText();
                    ArrayList<garantiaHipotecariaDTO> lista = garaHipo.ListarPorApellidoPaternoHipo(apellido);
        
          
                    DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
                    modelo.setNumRows(0);
                    modelo.setColumnCount(0);
                 if(modelo.getColumnCount()<1)
                 {
                    Object[]arr1={
                            "N°FOLIO",
                            "RUT",
                            "NOMBRE",
                            "APELLIDO PATERNO",
                            "APELLIDO MATERNO",
                            "SUCURSAL",
                            "COBERTURA",
                            "SUPERFICIE",
                            "REGISTRO CBR",
                            "ROL SII",
                            "FECHA CREACIÓN",
                            "FECHA EXTINCIÓN",
                            "MONEDA",
                            "TIPO CONSTRUCCIÓN",
                            "COMUNA",
                            "ESTADO CONTRIBUCIÓN",
                            "MTRS. CONSTRUIDOS",
                            "ESTADO GARANTÍA"

                            };
                        modelo.setColumnIdentifiers(arr1);
                     }

                    for(garantiaHipotecariaDTO h: lista)
                    {
                        String fei = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_crea_hipo()));
                        String fev = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_extincion_hipo()));
                        Object[]arr={
                            h.getFolio_garantia_hipo(),
                            h.getRut_gara_hipo(),
                            h.getNombre_hipo(),
                            h.getApell_paterno_hipo(),
                            h.getApell_materno_hipo(),
                            h.getSucursal_hipo(),
                            h.getCobertura_hipo(),
                            h.getSuperficie_hipo(),
                            h.getRegistro_cbr_hipo(),
                            h.getRol_sii_hipo(),
                            fei,
                            fev,
                            h.getMoneda_hipo(),
                            h.getTipo_construccion_hipo(),
                            h.getComuna_hipo(),
                            h.getEstado_constrib_hipo(),
                            h.getMts_construidos_hipo(),
                            h.getEstado_hipo()
                            };

                        modelo.addRow(arr);


                    }

                    TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(100);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(120);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(100);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(170);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(100);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(170);
           TableColumn colum17 = this.tbSalidaInforme.getColumnModel().getColumn(16);
           colum17.setPreferredWidth(170);
           TableColumn colum18 = this.tbSalidaInforme.getColumnModel().getColumn(17);
           colum18.setPreferredWidth(140);
                }
                else if(rbtEstadoGarantia.isSelected())
                {
                    String estado = this.cmbEstadoGarantia.getSelectedItem().toString().trim();
                    ArrayList<garantiaHipotecariaDTO> lista = garaHipo.ListarPorEstadoHipo(estado);
        
          
                    DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
                    modelo.setNumRows(0);
                    modelo.setColumnCount(0);
                 if(modelo.getColumnCount()<1)
                 {
                    Object[]arr1={
                            "N°FOLIO",
                            "RUT",
                            "NOMBRE",
                            "APELLIDO PATERNO",
                            "APELLIDO MATERNO",
                            "SUCURSAL",
                            "COBERTURA",
                            "SUPERFICIE",
                            "REGISTRO CBR",
                            "ROL SII",
                            "FECHA CREACIÓN",
                            "FECHA EXTINCIÓN",
                            "MONEDA",
                            "TIPO CONSTRUCCIÓN",
                            "COMUNA",
                            "ESTADO CONTRIBUCIÓN",
                            "MTRS. CONSTRUIDOS",
                            "ESTADO GARANTÍA"

                            };
                        modelo.setColumnIdentifiers(arr1);
                     }

                    for(garantiaHipotecariaDTO h: lista)
                    {
                        String fei = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_crea_hipo()));
                        String fev = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_extincion_hipo()));
                        Object[]arr={
                            h.getFolio_garantia_hipo(),
                            h.getRut_gara_hipo(),
                            h.getNombre_hipo(),
                            h.getApell_paterno_hipo(),
                            h.getApell_materno_hipo(),
                            h.getSucursal_hipo(),
                            h.getCobertura_hipo(),
                            h.getSuperficie_hipo(),
                            h.getRegistro_cbr_hipo(),
                            h.getRol_sii_hipo(),
                            fei,
                            fev,
                            h.getMoneda_hipo(),
                            h.getTipo_construccion_hipo(),
                            h.getComuna_hipo(),
                            h.getEstado_constrib_hipo(),
                            h.getMts_construidos_hipo(),
                            h.getEstado_hipo()
                            };

                        modelo.addRow(arr);


                    }

                    TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(100);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(120);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(100);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(170);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(100);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(170);
           TableColumn colum17 = this.tbSalidaInforme.getColumnModel().getColumn(16);
           colum17.setPreferredWidth(170);
           TableColumn colum18 = this.tbSalidaInforme.getColumnModel().getColumn(17);
           colum18.setPreferredWidth(140);
                }
                else if(rbtFechaIngreso.isSelected())
                {
                    
                    ArrayList<garantiaHipotecariaDTO> lista = garaHipo.ListarPorFechasIngresoHipo(new Date(this.jCalendarFechaIngresoDesde.getDate().getTime()), new Date(this.jCalendarFechaIngresoHasta.getDate().getTime()));
        
          
                    DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
                    modelo.setNumRows(0);
                    modelo.setColumnCount(0);
                 if(modelo.getColumnCount()<1)
                 {
                    Object[]arr1={
                            "N°FOLIO",
                            "RUT",
                            "NOMBRE",
                            "APELLIDO PATERNO",
                            "APELLIDO MATERNO",
                            "SUCURSAL",
                            "COBERTURA",
                            "SUPERFICIE",
                            "REGISTRO CBR",
                            "ROL SII",
                            "FECHA CREACIÓN",
                            "FECHA EXTINCIÓN",
                            "MONEDA",
                            "TIPO CONSTRUCCIÓN",
                            "COMUNA",
                            "ESTADO CONTRIBUCIÓN",
                            "MTRS. CONSTRUIDOS",
                            "ESTADO GARANTÍA"

                            };
                        modelo.setColumnIdentifiers(arr1);
                     }

                    for(garantiaHipotecariaDTO h: lista)
                    {
                        String fei = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_crea_hipo()));
                        String fev = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_extincion_hipo()));
                        Object[]arr={
                            h.getFolio_garantia_hipo(),
                            h.getRut_gara_hipo(),
                            h.getNombre_hipo(),
                            h.getApell_paterno_hipo(),
                            h.getApell_materno_hipo(),
                            h.getSucursal_hipo(),
                            h.getCobertura_hipo(),
                            h.getSuperficie_hipo(),
                            h.getRegistro_cbr_hipo(),
                            h.getRol_sii_hipo(),
                            fei,
                            fev,
                            h.getMoneda_hipo(),
                            h.getTipo_construccion_hipo(),
                            h.getComuna_hipo(),
                            h.getEstado_constrib_hipo(),
                            h.getMts_construidos_hipo(),
                            h.getEstado_hipo()
                            };

                        modelo.addRow(arr);


                    }

                    TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(100);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(120);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(100);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(170);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(100);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(170);
           TableColumn colum17 = this.tbSalidaInforme.getColumnModel().getColumn(16);
           colum17.setPreferredWidth(170);
           TableColumn colum18 = this.tbSalidaInforme.getColumnModel().getColumn(17);
           colum18.setPreferredWidth(140);
                }
                else if(rbtFechaVencimiento.isSelected())
                {
                    
                    ArrayList<garantiaHipotecariaDTO> lista = garaHipo.ListarPorFechasVencimientoHipo(new Date(this.jCalendarFechaVencimientoDesde.getDate().getTime()), new Date(this.jCalendarFechaVencimientoHasta.getDate().getTime()));
        
          
                    DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
                    modelo.setNumRows(0);
                    modelo.setColumnCount(0);
                 if(modelo.getColumnCount()<1)
                 {
                    Object[]arr1={
                            "N°FOLIO",
                            "RUT",
                            "NOMBRE",
                            "APELLIDO PATERNO",
                            "APELLIDO MATERNO",
                            "SUCURSAL",
                            "COBERTURA",
                            "SUPERFICIE",
                            "REGISTRO CBR",
                            "ROL SII",
                            "FECHA CREACIÓN",
                            "FECHA EXTINCIÓN",
                            "MONEDA",
                            "TIPO CONSTRUCCIÓN",
                            "COMUNA",
                            "ESTADO CONTRIBUCIÓN",
                            "MTRS. CONSTRUIDOS",
                            "ESTADO GARANTÍA"

                            };
                        modelo.setColumnIdentifiers(arr1);
                     }

                    for(garantiaHipotecariaDTO h: lista)
                    {
                        String fei = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_crea_hipo()));
                        String fev = (new SimpleDateFormat("dd-MM-yyyy").format(h.getFech_extincion_hipo()));
                        Object[]arr={
                            h.getFolio_garantia_hipo(),
                            h.getRut_gara_hipo(),
                            h.getNombre_hipo(),
                            h.getApell_paterno_hipo(),
                            h.getApell_materno_hipo(),
                            h.getSucursal_hipo(),
                            h.getCobertura_hipo(),
                            h.getSuperficie_hipo(),
                            h.getRegistro_cbr_hipo(),
                            h.getRol_sii_hipo(),
                            fei,
                            fev,
                            h.getMoneda_hipo(),
                            h.getTipo_construccion_hipo(),
                            h.getComuna_hipo(),
                            h.getEstado_constrib_hipo(),
                            h.getMts_construidos_hipo(),
                            h.getEstado_hipo()
                            };

                        modelo.addRow(arr);


                    }

                    TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(100);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(120);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(100);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(170);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(100);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(170);
           TableColumn colum17 = this.tbSalidaInforme.getColumnModel().getColumn(16);
           colum17.setPreferredWidth(170);
           TableColumn colum18 = this.tbSalidaInforme.getColumnModel().getColumn(17);
           colum18.setPreferredWidth(140);
                }
            } ///FIN DEL RADIOBUTTON HIPOTECARIO
            
            //COMIENZO RADIOBUTTON AUTOMOTRIZ
            else if(rbtAutomotriz.isSelected())
            {
                if(rbtRut.isSelected())
                {
                    String rut = this.txtRut.getText();
                    ArrayList<garantiaAutomotrizDTO> lista = garaAuto.ListarPorRutAuto(rut);
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MARCA",
                   "PATENTE",
                   "N° CHASIS",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "N° MOTOR",
                   "MODELO",
                   "N° REGISTRO PRENDA", 
                   "ESTADO GARANTÍA",
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaAutomotrizDTO a: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_crea_auto()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_extincion_auto()));
               Object[]arr={
                   a.getFolio_garantia_auto(),
                   a.getRut_gara_auto(),
                   a.getNombre_auto(),
                   a.getApell_paterno_auto(),
                   a.getApell_materno_auto(),
                   a.getSucursal_auto(),
                   a.getMarca_auto(),
                   a.getPatente_auto(),
                   a.getNum_chasis_auto(),
                   fei,
                   fev,
                   a.getMoneda_auto(),
                   a.getNum_motor_auto(),
                   a.getModelo_auto(),
                   a.getNum_reg_prenda_auto(),
                   a.getEstado_auto()
                   };
               modelo.addRow(arr);
           }
           
          TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(130);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(110);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(120);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(160);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(130);
                }
                else if(rbtApellidoPaterno.isSelected())
                {
                    String apellido = this.txtApellidoPaterno.getText();
                    ArrayList<garantiaAutomotrizDTO> lista = garaAuto.ListarPorApellidoPaternoAuto(apellido);
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MARCA",
                   "PATENTE",
                   "N° CHASIS",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "N° MOTOR",
                   "MODELO",
                   "N° REGISTRO PRENDA", 
                   "ESTADO GARANTÍA",
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaAutomotrizDTO a: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_crea_auto()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_extincion_auto()));
               Object[]arr={
                   a.getFolio_garantia_auto(),
                   a.getRut_gara_auto(),
                   a.getNombre_auto(),
                   a.getApell_paterno_auto(),
                   a.getApell_materno_auto(),
                   a.getSucursal_auto(),
                   a.getMarca_auto(),
                   a.getPatente_auto(),
                   a.getNum_chasis_auto(),
                   fei,
                   fev,
                   a.getMoneda_auto(),
                   a.getNum_motor_auto(),
                   a.getModelo_auto(),
                   a.getNum_reg_prenda_auto(),
                   a.getEstado_auto()
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(130);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(110);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(120);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(160);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(130);
                }
                else if(rbtEstadoGarantia.isSelected())
                {
                    String estado = this.cmbEstadoGarantia.getSelectedItem().toString().trim();
                    ArrayList<garantiaAutomotrizDTO> lista = garaAuto.ListarPorEstadoAuto(estado);
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MARCA",
                   "PATENTE",
                   "N° CHASIS",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "N° MOTOR",
                   "MODELO",
                   "N° REGISTRO PRENDA", 
                   "ESTADO GARANTÍA",
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaAutomotrizDTO a: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_crea_auto()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_extincion_auto()));
               Object[]arr={
                   a.getFolio_garantia_auto(),
                   a.getRut_gara_auto(),
                   a.getNombre_auto(),
                   a.getApell_paterno_auto(),
                   a.getApell_materno_auto(),
                   a.getSucursal_auto(),
                   a.getMarca_auto(),
                   a.getPatente_auto(),
                   a.getNum_chasis_auto(),
                   fei,
                   fev,
                   a.getMoneda_auto(),
                   a.getNum_motor_auto(),
                   a.getModelo_auto(),
                   a.getNum_reg_prenda_auto(),
                   a.getEstado_auto()
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(130);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(110);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(120);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(160);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(130);
                }
                else if(rbtFechaIngreso.isSelected())
                {
                    ArrayList<garantiaAutomotrizDTO> lista = garaAuto.ListarPorFechaIngresoAuto(new Date(this.jCalendarFechaIngresoDesde.getDate().getTime()), new Date(this.jCalendarFechaIngresoHasta.getDate().getTime()));
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MARCA",
                   "PATENTE",
                   "N° CHASIS",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "N° MOTOR",
                   "MODELO",
                   "N° REGISTRO PRENDA", 
                   "ESTADO GARANTÍA",
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaAutomotrizDTO a: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_crea_auto()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_extincion_auto()));
               Object[]arr={
                   a.getFolio_garantia_auto(),
                   a.getRut_gara_auto(),
                   a.getNombre_auto(),
                   a.getApell_paterno_auto(),
                   a.getApell_materno_auto(),
                   a.getSucursal_auto(),
                   a.getMarca_auto(),
                   a.getPatente_auto(),
                   a.getNum_chasis_auto(),
                   fei,
                   fev,
                   a.getMoneda_auto(),
                   a.getNum_motor_auto(),
                   a.getModelo_auto(),
                   a.getNum_reg_prenda_auto(),
                   a.getEstado_auto()
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(130);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(110);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(120);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(160);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(130);
                }
                else if(rbtFechaVencimiento.isSelected())
                {
                    ArrayList<garantiaAutomotrizDTO> lista = garaAuto.ListarPorFechaVencimientoAuto(new Date(this.jCalendarFechaVencimientoDesde.getDate().getTime()), new Date(this.jCalendarFechaVencimientoHasta.getDate().getTime()));
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MARCA",
                   "PATENTE",
                   "N° CHASIS",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "MONEDA",
                   "N° MOTOR",
                   "MODELO",
                   "N° REGISTRO PRENDA", 
                   "ESTADO GARANTÍA",
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaAutomotrizDTO a: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_crea_auto()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(a.getFech_extincion_auto()));
               Object[]arr={
                   a.getFolio_garantia_auto(),
                   a.getRut_gara_auto(),
                   a.getNombre_auto(),
                   a.getApell_paterno_auto(),
                   a.getApell_materno_auto(),
                   a.getSucursal_auto(),
                   a.getMarca_auto(),
                   a.getPatente_auto(),
                   a.getNum_chasis_auto(),
                   fei,
                   fev,
                   a.getMoneda_auto(),
                   a.getNum_motor_auto(),
                   a.getModelo_auto(),
                   a.getNum_reg_prenda_auto(),
                   a.getEstado_auto()
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(130);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(110);
           TableColumn colum13 = this.tbSalidaInforme.getColumnModel().getColumn(12);
           colum13.setPreferredWidth(100);
           TableColumn colum14 = this.tbSalidaInforme.getColumnModel().getColumn(13);
           colum14.setPreferredWidth(120);
           TableColumn colum15 = this.tbSalidaInforme.getColumnModel().getColumn(14);
           colum15.setPreferredWidth(160);
           TableColumn colum16 = this.tbSalidaInforme.getColumnModel().getColumn(15);
           colum16.setPreferredWidth(130);
                }
            }//TERMINO RADIOBUTTON AUTOMOTRIZ
            
            //COMIENZO RADIOBUTTON WARRANT
            else if(rbtWarrant.isSelected())
            {
                if(rbtRut.isSelected())
                {
                    String rut = this.txtRut.getText();
                    ArrayList<garantiaWarrantsDTO> lista = garaWarra.ListarPorRutWarra(rut);
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "TIPO PRODUCTO",
                   "PRODUCTO",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaWarrantsDTO w: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_crea_warra()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_exti_warra()));
               Object[]arr={
                   w.getFolio_warra(),
                   w.getRut_garante_warra(),
                   w.getNombre_warra(),
                   w.getApell_paterno_warra(),
                   w.getApell_materno_warra(),
                   w.getNom_sucursal_warra(),
                   w.getTipo_prod_warra(),
                   w.getIngre_prod_warra(),
                   w.getNom_moneda_warra(),
                   fei,
                   fev,
                   w.getEstado_warra()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(170);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(100);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
                }
                else if(rbtApellidoPaterno.isSelected())
                {
                    String apellido = this.txtApellidoPaterno.getText();
                    ArrayList<garantiaWarrantsDTO> lista = garaWarra.ListarPorApellidoPaternoWarra(apellido);
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "TIPO PRODUCTO",
                   "PRODUCTO",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaWarrantsDTO w: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_crea_warra()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_exti_warra()));
               Object[]arr={
                   w.getFolio_warra(),
                   w.getRut_garante_warra(),
                   w.getNombre_warra(),
                   w.getApell_paterno_warra(),
                   w.getApell_materno_warra(),
                   w.getNom_sucursal_warra(),
                   w.getTipo_prod_warra(),
                   w.getIngre_prod_warra(),
                   w.getNom_moneda_warra(),
                   fei,
                   fev,
                   w.getEstado_warra()
                   
                   };
               modelo.addRow(arr);
           }
           
          TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(170);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(100);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
                }
                else if(rbtEstadoGarantia.isSelected())
                {
                    String estado = this.cmbEstadoGarantia.getSelectedItem().toString().trim();
                    ArrayList<garantiaWarrantsDTO> lista = garaWarra.ListarPorEstadoWarra(estado);
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "TIPO PRODUCTO",
                   "PRODUCTO",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaWarrantsDTO w: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_crea_warra()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_exti_warra()));
               Object[]arr={
                   w.getFolio_warra(),
                   w.getRut_garante_warra(),
                   w.getNombre_warra(),
                   w.getApell_paterno_warra(),
                   w.getApell_materno_warra(),
                   w.getNom_sucursal_warra(),
                   w.getTipo_prod_warra(),
                   w.getIngre_prod_warra(),
                   w.getNom_moneda_warra(),
                   fei,
                   fev,
                   w.getEstado_warra()
                   
                   };
               modelo.addRow(arr);
           }
           
          TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(170);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(100);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
                }
                else if(rbtFechaIngreso.isSelected())
                {
                    
                    ArrayList<garantiaWarrantsDTO> lista = garaWarra.ListarPorFechaIngresoWarra(new Date(this.jCalendarFechaIngresoDesde.getDate().getTime()), new Date(this.jCalendarFechaIngresoHasta.getDate().getTime()));
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "TIPO PRODUCTO",
                   "PRODUCTO",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaWarrantsDTO w: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_crea_warra()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_exti_warra()));
               Object[]arr={
                   w.getFolio_warra(),
                   w.getRut_garante_warra(),
                   w.getNombre_warra(),
                   w.getApell_paterno_warra(),
                   w.getApell_materno_warra(),
                   w.getNom_sucursal_warra(),
                   w.getTipo_prod_warra(),
                   w.getIngre_prod_warra(),
                   w.getNom_moneda_warra(),
                   fei,
                   fev,
                   w.getEstado_warra()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(170);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(100);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
                }
                else if(rbtFechaVencimiento.isSelected())
                {
                    
                    ArrayList<garantiaWarrantsDTO> lista = garaWarra.ListarPorFechaVencimientoWarra(new Date(this.jCalendarFechaVencimientoDesde.getDate().getTime()), new Date(this.jCalendarFechaVencimientoHasta.getDate().getTime()));
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "TIPO PRODUCTO",
                   "PRODUCTO",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaWarrantsDTO w: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_crea_warra()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(w.getFech_exti_warra()));
               Object[]arr={
                   w.getFolio_warra(),
                   w.getRut_garante_warra(),
                   w.getNombre_warra(),
                   w.getApell_paterno_warra(),
                   w.getApell_materno_warra(),
                   w.getNom_sucursal_warra(),
                   w.getTipo_prod_warra(),
                   w.getIngre_prod_warra(),
                   w.getNom_moneda_warra(),
                   fei,
                   fev,
                   w.getEstado_warra()
                   
                   };
               modelo.addRow(arr);
           }
           
          TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(170);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(100);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
           TableColumn colum11 = this.tbSalidaInforme.getColumnModel().getColumn(10);
           colum11.setPreferredWidth(130);
           TableColumn colum12 = this.tbSalidaInforme.getColumnModel().getColumn(11);
           colum12.setPreferredWidth(130);
                }
            }//TERMINO RADIOBUTTON WARRANT
            
            //COMIENZO RADIOBUTTON CDP
            else if(rbtCDP.isSelected())
            {
                if(rbtRut.isSelected())
                {
                    String rut = this.txtRut.getText();
                    ArrayList<garantiaCdpOtrosDTO> lista = garaCdp.ListarPorRutCdp(rut);
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaCdpOtrosDTO c: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_crea_cdp()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_extin_cdp()));
               Object[]arr={
                   c.getFolio_cdp(),
                   c.getRut_gara_cdp(),
                   c.getNombre_cdp(),
                   c.getApell_paterno_cdp(),
                   c.getApell_materno_cdp(),
                   c.getSucu_cdp(),
                   c.getNom_moneda_cdp(),
                   fei,
                   fev,
                   c.getEstado_cdp()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
                }
                else if(rbtApellidoPaterno.isSelected())
                {
                    String apellido = this.txtApellidoPaterno.getText();
                    ArrayList<garantiaCdpOtrosDTO> lista = garaCdp.ListarPorApellidoPaternoCdp(apellido);
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaCdpOtrosDTO c: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_crea_cdp()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_extin_cdp()));
               Object[]arr={
                   c.getFolio_cdp(),
                   c.getRut_gara_cdp(),
                   c.getNombre_cdp(),
                   c.getApell_paterno_cdp(),
                   c.getApell_materno_cdp(),
                   c.getSucu_cdp(),
                   c.getNom_moneda_cdp(),
                   fei,
                   fev,
                   c.getEstado_cdp()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
                }
                else if(rbtEstadoGarantia.isSelected())
                {
                    String estado = this.cmbEstadoGarantia.getSelectedItem().toString().trim();
                    ArrayList<garantiaCdpOtrosDTO> lista = garaCdp.ListarPorEstadoCdp(estado);
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaCdpOtrosDTO c: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_crea_cdp()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_extin_cdp()));
               Object[]arr={
                   c.getFolio_cdp(),
                   c.getRut_gara_cdp(),
                   c.getNombre_cdp(),
                   c.getApell_paterno_cdp(),
                   c.getApell_materno_cdp(),
                   c.getSucu_cdp(),
                   c.getNom_moneda_cdp(),
                   fei,
                   fev,
                   c.getEstado_cdp()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
                }
                else if(rbtFechaIngreso.isSelected())
                {
                    ArrayList<garantiaCdpOtrosDTO> lista = garaCdp.ListarPorFechaIngresoCdp(new Date(this.jCalendarFechaIngresoDesde.getDate().getTime()), new Date(this.jCalendarFechaIngresoHasta.getDate().getTime()));
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaCdpOtrosDTO c: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_crea_cdp()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_extin_cdp()));
               Object[]arr={
                   c.getFolio_cdp(),
                   c.getRut_gara_cdp(),
                   c.getNombre_cdp(),
                   c.getApell_paterno_cdp(),
                   c.getApell_materno_cdp(),
                   c.getSucu_cdp(),
                   c.getNom_moneda_cdp(),
                   fei,
                   fev,
                   c.getEstado_cdp()
                   
                   };
               modelo.addRow(arr);
           }
           
           TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
                }
                else if(rbtFechaVencimiento.isSelected())
                {
                    ArrayList<garantiaCdpOtrosDTO> lista = garaCdp.ListarPorFechaVencimientoCdp(new Date(this.jCalendarFechaVencimientoDesde.getDate().getTime()), new Date(this.jCalendarFechaVencimientoDesde.getDate().getTime()));
       
           DefaultTableModel modelo = (DefaultTableModel)this.tbSalidaInforme.getModel();
           modelo.setNumRows(0);
           modelo.setColumnCount(0);
           if(modelo.getColumnCount()<1)
        {
           Object[]arr1={
                   "N°FOLIO",
                   "RUT",
                   "NOMBRE",
                   "APELLIDO PATERNO",
                   "APELLIDO MATERNO",
                   "SUCURSAL",
                   "MONEDA",
                   "FECHA CREACIÓN",
                   "FECHA EXTINCIÓN",
                   "ESTADO GARANTÍA"
                   
           
                   };
               modelo.setColumnIdentifiers(arr1);
        }
           for(garantiaCdpOtrosDTO c: lista)
           {
               String fei = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_crea_cdp()));
               String fev = (new SimpleDateFormat("dd-MM-yyyy").format(c.getFech_extin_cdp()));
               Object[]arr={
                   c.getFolio_cdp(),
                   c.getRut_gara_cdp(),
                   c.getNombre_cdp(),
                   c.getApell_paterno_cdp(),
                   c.getApell_materno_cdp(),
                   c.getSucu_cdp(),
                   c.getNom_moneda_cdp(),
                   fei,
                   fev,
                   c.getEstado_cdp()
                   
                   };
               modelo.addRow(arr);
           }
           
          TableColumn colum1 = this.tbSalidaInforme.getColumnModel().getColumn(0);
           colum1.setPreferredWidth(100);
           TableColumn colum2 = this.tbSalidaInforme.getColumnModel().getColumn(1);
           colum2.setPreferredWidth(100);
           TableColumn colum3 = this.tbSalidaInforme.getColumnModel().getColumn(2);
           colum3.setPreferredWidth(100);
           TableColumn colum4 = this.tbSalidaInforme.getColumnModel().getColumn(3);
           colum4.setPreferredWidth(170);
           TableColumn colum5 = this.tbSalidaInforme.getColumnModel().getColumn(4);
           colum5.setPreferredWidth(170);
           TableColumn colum6 = this.tbSalidaInforme.getColumnModel().getColumn(5);
           colum6.setPreferredWidth(170);
           TableColumn colum7 = this.tbSalidaInforme.getColumnModel().getColumn(6);
           colum7.setPreferredWidth(120);
           TableColumn colum8 = this.tbSalidaInforme.getColumnModel().getColumn(7);
           colum8.setPreferredWidth(130);
           TableColumn colum9 = this.tbSalidaInforme.getColumnModel().getColumn(8);
           colum9.setPreferredWidth(130);
           TableColumn colum10 = this.tbSalidaInforme.getColumnModel().getColumn(9);
           colum10.setPreferredWidth(130);
                }
            }//TERMINO RADIOBUTTON CDP
        }
        catch(Exception e)
        {
            e.getMessage();
        }
    }//GEN-LAST:event_btnBuscarPorParametrosActionPerformed

    private void rbtRutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtRutActionPerformed
       ///EDITA CAJAS DE TEXTO
       Color opaco1 = new Color(250,250,250);
       this.txtRut.setBackground(opaco1); 
       Color opaco = new Color(240,240,240);
       this.txtApellidoPaterno.setBackground(opaco);
       this.txtApellidoPaterno.setEnabled(false);
       this.txtRut.setEnabled(true);
       this.cmbEstadoGarantia.setEnabled(false);
       this.jCalendarFechaIngresoDesde.setEnabled(false);
       this.jCalendarFechaIngresoHasta.setEnabled(false);
       this.jCalendarFechaVencimientoDesde.setEnabled(false);
       this.jCalendarFechaVencimientoHasta.setEnabled(false);
       
       ///LIMPIAR
       this.txtApellidoPaterno.setText(null);
       this.cmbEstadoGarantia.setSelectedItem("(SELECCIONE)");
       this.jCalendarFechaIngresoDesde.setCalendar(null);
       this.jCalendarFechaIngresoHasta.setCalendar(null);
       this.jCalendarFechaVencimientoDesde.setCalendar(null);
       this.jCalendarFechaVencimientoHasta.setCalendar(null);
       
    }//GEN-LAST:event_rbtRutActionPerformed

    private void rbtApellidoPaternoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtApellidoPaternoActionPerformed
         ///EDITA CAJAS DE TEXTO
       Color opaco1 = new Color(240,240,240);
       this.txtRut.setBackground(opaco1); 
       this.txtRut.setEnabled(false);
       Color opaco = new Color(250,250,250);
       this.txtApellidoPaterno.setBackground(opaco);
       this.txtApellidoPaterno.setEnabled(true);
       this.cmbEstadoGarantia.setEnabled(false);
       this.jCalendarFechaIngresoDesde.setEnabled(false);
       this.jCalendarFechaIngresoHasta.setEnabled(false);
       this.jCalendarFechaVencimientoDesde.setEnabled(false);
       this.jCalendarFechaVencimientoHasta.setEnabled(false);
       
       ///LIMPIAR
       this.txtRut.setText(null);
       this.cmbEstadoGarantia.setSelectedItem("(SELECCIONE)");
       this.jCalendarFechaIngresoDesde.setCalendar(null);
       this.jCalendarFechaIngresoHasta.setCalendar(null);
       this.jCalendarFechaVencimientoDesde.setCalendar(null);
       this.jCalendarFechaVencimientoHasta.setCalendar(null);
       
    }//GEN-LAST:event_rbtApellidoPaternoActionPerformed

    private void rbtEstadoGarantiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtEstadoGarantiaActionPerformed
        ///EDITA CAJAS DE TEXTO
        Color opaco1 = new Color(240,240,240);
       this.txtRut.setBackground(opaco1); 
       this.txtRut.setEnabled(false);
       Color opaco = new Color(240,240,240);
       this.txtApellidoPaterno.setBackground(opaco);
       this.txtApellidoPaterno.setEnabled(false);
       this.cmbEstadoGarantia.setEnabled(true);
       this.jCalendarFechaIngresoDesde.setEnabled(false);
       this.jCalendarFechaIngresoHasta.setEnabled(false);
       this.jCalendarFechaVencimientoDesde.setEnabled(false);
       this.jCalendarFechaVencimientoHasta.setEnabled(false);
       
       ///LIMPIAR
       this.txtRut.setText(null);
       this.txtApellidoPaterno.setText(null);
       this.jCalendarFechaIngresoDesde.setCalendar(null);
       this.jCalendarFechaIngresoHasta.setCalendar(null);
       this.jCalendarFechaVencimientoDesde.setCalendar(null);
       this.jCalendarFechaVencimientoHasta.setCalendar(null);
    }//GEN-LAST:event_rbtEstadoGarantiaActionPerformed

    private void rbtFechaIngresoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtFechaIngresoActionPerformed
         ///EDITA CAJAS DE TEXTO
       Color opaco1 = new Color(240,240,240);
       this.txtRut.setBackground(opaco1); 
       this.txtRut.setEnabled(false);
       Color opaco = new Color(240,240,240);
       this.txtApellidoPaterno.setBackground(opaco);
       this.txtApellidoPaterno.setEnabled(false);
       this.cmbEstadoGarantia.setEnabled(false);
       this.jCalendarFechaIngresoDesde.setEnabled(true);
       this.jCalendarFechaIngresoHasta.setEnabled(true);
       this.jCalendarFechaVencimientoDesde.setEnabled(false);
       this.jCalendarFechaVencimientoHasta.setEnabled(false);
       
       ///LIMPIAR
       this.txtRut.setText(null);
       this.txtApellidoPaterno.setText(null);
       this.cmbEstadoGarantia.setSelectedItem("(SELECCIONE)");
       this.jCalendarFechaVencimientoDesde.setCalendar(null);
       this.jCalendarFechaVencimientoHasta.setCalendar(null);
    }//GEN-LAST:event_rbtFechaIngresoActionPerformed

    private void rbtFechaVencimientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtFechaVencimientoActionPerformed
        ///EDITA CAJAS DE TEXTO
        Color opaco1 = new Color(240,240,240);
       this.txtRut.setBackground(opaco1); 
       this.txtRut.setEnabled(false);
       Color opaco = new Color(240,240,240);
       this.txtApellidoPaterno.setBackground(opaco);
       this.txtApellidoPaterno.setEnabled(false);
       this.cmbEstadoGarantia.setEnabled(false);
       this.jCalendarFechaIngresoDesde.setEnabled(false);
       this.jCalendarFechaIngresoHasta.setEnabled(false);
       this.jCalendarFechaVencimientoDesde.setEnabled(true);
       this.jCalendarFechaVencimientoHasta.setEnabled(true);
       
       ///LIMPIAR
       this.txtRut.setText(null);
       this.txtApellidoPaterno.setText(null);
       this.cmbEstadoGarantia.setSelectedItem("(SELECCIONE)");
       this.jCalendarFechaIngresoDesde.setCalendar(null);
       this.jCalendarFechaIngresoHasta.setCalendar(null);
    }//GEN-LAST:event_rbtFechaVencimientoActionPerformed

    /**
     * @param args the command line arguments
     */
//    public static void main(String args[]) {
//        /*
//         * Set the Nimbus look and feel
//         */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /*
//         * If Nimbus (introduced in Java SE 6) is not available, stay with the
//         * default look and feel. For details see
//         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(InformeTotalGtia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(InformeTotalGtia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(InformeTotalGtia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(InformeTotalGtia.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /*
//         * Create and display the form
//         */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new InformeTotalGtia().setVisible(true);
//            }
//        });
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuscarPorParametros;
    private javax.swing.JButton btnBuscarSinParametros;
    private javax.swing.JButton btnImprimirInformeGarantia;
    private javax.swing.JButton btnVolver1;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.JCheckBox chkBuscarConParametros;
    private javax.swing.JCheckBox chkBuscarSinParametros;
    private javax.swing.JComboBox cmbEstadoGarantia;
    private com.toedter.calendar.JDateChooser jCalendarFechaIngresoDesde;
    private com.toedter.calendar.JDateChooser jCalendarFechaIngresoHasta;
    private com.toedter.calendar.JDateChooser jCalendarFechaVencimientoDesde;
    private com.toedter.calendar.JDateChooser jCalendarFechaVencimientoHasta;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanelBuscarSinParametros;
    private javax.swing.JPanel jPanelConParametros;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JRadioButton rbtApellidoPaterno;
    private javax.swing.JRadioButton rbtAutomotriz;
    private javax.swing.JRadioButton rbtCDP;
    private javax.swing.JRadioButton rbtEstadoGarantia;
    private javax.swing.JRadioButton rbtFechaIngreso;
    private javax.swing.JRadioButton rbtFechaVencimiento;
    private javax.swing.JRadioButton rbtHipotecaria;
    private javax.swing.JRadioButton rbtRut;
    private javax.swing.JRadioButton rbtWarrant;
    private javax.swing.JTable tbSalidaInforme;
    private javax.swing.JTextField txtApellidoPaterno;
    private javax.swing.JTextField txtRut;
    // End of variables declaration//GEN-END:variables


}
